package com.song.mybatis.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.song.mybatis.mapper.master.MasterMapper;
import com.song.mybatis.mapper.second.SecondMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TestController {
    @Autowired
    private MasterMapper masterMapper;
    @Autowired
    private SecondMapper secondMapper;

    @GetMapping("get")
    public Object get(){
        PageInfo<Object> pageInfo1 = PageHelper.startPage(1, 10).doSelectPageInfo(() -> masterMapper.list());
        PageInfo<Object> pageInfo2 = PageHelper.startPage(1, 10).doSelectPageInfo(() -> secondMapper.list());
        return pageInfo1;
    }
}
